package com.crusinnovation.unitTest.comparator;

import java.util.Calendar;
import java.util.GregorianCalendar;

import junit.framework.JUnit4TestAdapter;

import org.junit.Test;

import com.cyrusinnovation.test.comparator.DateAscending;
import com.cyrusinnovation.test.record.PersonRecord;

public class DateAscendingTest extends RecordComparatorTestRunner {

	@Test
	public void testCompare() {
		PersonRecord r1 = new PersonRecord();
		PersonRecord r2 = new PersonRecord();
		setComparator(new DateAscending());
		Calendar calendar = new GregorianCalendar();
		calendar.set(10,9,2010); //10/10/2010
		r1.setDateOfBirth(calendar.getTime());
		
		calendar.clear();
		calendar.set(1,0,2001); //1/1/2001
		r2.setDateOfBirth(calendar.getTime());

		runCompareToTest(r2, r1, "1/1/2001<10/10/2010");
	}
	public static junit.framework.Test suite() { 
	    return new JUnit4TestAdapter(DateAscendingTest.class); 
	}

}
